<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
       var arr = [{name:"张三",children:[]},{name:"李四",children:[]},{name:"王五",children:[]}];
       arr[0].children.push(arr[1]);
       arr[1].children.push(arr[2]);
       console.log(arr)
    
       var obj = {name:"1",speak:function(){console.log("我是谁谁谁")},children:[]};
       var obj2 = obj;
       console.log(obj2);
       
       console.log(JSON.stringify(obj));
       console.log(typeof JSON.parse('2'));
       var obj3 = JSON.parse(JSON.stringify(obj));
       obj3.name = "钱六";
       console.log(obj3)
       console.log(obj)
       console.log(JSON.stringify(null))

       var lobj = {};
       lobj.name = obj.name;
       lobj.name = 2;
      
        for(var key in obj){
            lobj[key] = obj[key];
            if(obj[key] ){

            }
        }
        console.log(lobj)
        console.log(obj)


        //
        var sbol = Symbol("a");
        var d = Symbol("a");
        console.log(sbol == d) ;
        var obj = {
            name:null,
            age:'20',
            children:{
                name:'小刚'
            }
        }
        obj[sbol] = "i is symbol"
        console.log(obj)
        console.log(Object.getOwnPropertySymbols(obj));
        console.log(Object.keys(obj))
        console.log('name' in obj);
        // for (const key in object) {
        //     if (object.hasOwnProperty(key)) {
        //         const element = object[key];
                
        //     }
        // }
        var obj4 = {name:"1",speak:function(){console.log("我是谁谁谁")},children:[]};
        Object.prototype.run = function(){
            console.log('我正在run')
        }
        Array.prototype.push = function(){
           
        }
        var arr2 = [];
        console.log(arr2.push(1));
        console.log(arr2)

        var bobj = Object.create(obj4);
        console.log(bobj);
        
    </script>
</body>
</html>